home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LTP_AddHistory.c < prev    next >
C/C++ Source or Header  |  1996-03-18  |  950b  |  44 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. VOID
  15. LTP_AddHistory(struct SGWork *Work)
  16. {
  17.     ObjectNode *Node;
  18.  
  19.     if(GETOBJECT(Work->Gadget,Node))
  20.     {
  21.         if(Node->Special.String.HistoryHook)
  22.         {
  23.             struct MinList *List = Node->Special.String.HistoryHook->h_Data;
  24.  
  25.             while(Node->Special.String.NumHistoryLines >= Node->Special.String.MaxHistoryLines)
  26.             {
  27.                 CallHookPkt(Node->Special.String.HistoryHook,Work->Gadget,NULL);
  28.  
  29.                 Node->Special.String.NumHistoryLines--;
  30.             }
  31.  
  32.             Work->WorkBuffer[Work->NumChars] = 0;
  33.  
  34.             if(CallHookPkt(Node->Special.String.HistoryHook,Work->Gadget,Work->WorkBuffer))
  35.                 Node->Special.String.NumHistoryLines++;
  36.  
  37.             if(List->mlh_Head->mln_Succ)
  38.                 Node->Special.String.CurrentNode = (struct Node *)List->mlh_TailPred;
  39.             else
  40.                 Node->Special.String.CurrentNode = NULL;
  41.         }
  42.     }
  43. }
  44.